<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../plugins/layui/css/layui.css" />
		<link href="../../kitAdmin/css/app.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" type="text/css" href="../../plugins/select2/dist/css/select2.min.css"/>
		<style type="text/css">
			.layui-unselect.layui-form-select {
			    display: none;
			}
		</style>
	</head>

	<body>
		<div style="margin: 10px" >
			<label>选择负责人：</label>
			<select lay-filter="_fuzerenSelect" data-link='{:fuzerenId}' id='_fuzerenSelect' name='fuzerenSelect' class='layui-input' style="width:280px">
<!-- 				<option></option> -->
<!-- 				<option value='all' selected='true'>全部负责人</option> -->
			</select>
		</div>
		<script src="../../common/js/jquery.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../static/js/base.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../plugins/jsviews/jsviews.js" type="text/javascript"></script>
		<script src="../../plugins/layui/layui.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../plugins/select2/dist/js/select2.min.js" type="text/javascript" charset="utf-8"></script>
	</body>
	<script type="text/javascript">
	var uid = getQueryVariable('orderId');
	jQuery(document).ready(function() {
		bindFuzerenSelect2();
		bindFormData();
	})
	
	function bindFuzerenSelect2() {
		var fuzerenData = [];
		$.ajax({
			type : "get",
			url :baseUrl+ '/admins/select2',
			async : false,
			success : function(data) {
				fuzerenData = data;
// 				fuzerenData.unshift({
// 					id : 'all',
// 					text : '请选择'
// 				});
			}
		});
		$('#_fuzerenSelect').select2({
			placeholder:'请选择负责人',
			allowClear: true,
			data : fuzerenData
		});
	}
	
	
	var callback_save=function(){
		return $('#_fuzerenSelect').val()+"&"+$('#_fuzerenSelect option:selected').text();
	}
	
	function bindFormData() {
		if(uid) {
			$.ajax({
				url:baseUrl+ '/freeAuditions/' + uid,
				type: 'get',
				success: function(data) {
					// 2018-9-25 chenbin: 如果有负责人，则刷新select
					if (data.data.fuzerenId != null && data.data.fuzerenId != '') {
						$.link(true, "#_fuzerenSelect", data.data);
						$('#_fuzerenSelect').select2().trigger('change');
					}
				},
				error: function() {
					parent.layer.alert('系统或网络错误！');
				}
			});
		}
	}
	
	</script>

</html>
